#import "LoggerClient.h"

#define LOGLEVEL_DEBUG    0
#define LOGLEVEL_INFO     1
#define LOGLEVEL_WARNING  2
#define LOGLEVEL_ERROR    3

#ifndef LOGLEVEL
#define LOGLEVEL LOGLEVEL_DEBUG
#endif

#define LogTag @"ColdJoke"

#ifdef DEBUG
#define DoLog(level, tag, ...) \
if (level >= LOGLEVEL) { \
LogMessageF(__FILE__,__LINE__,__FUNCTION__, tag, level,__VA_ARGS__); \
}
#else
#define DoLog(level, tag, ...)  ((void)0)
#endif

#define LogError(...) DoLog(LOGLEVEL_ERROR, LogTag, __VA_ARGS__)
#define LogWarning(...) DoLog(LOGLEVEL_WARNING, LogTag, __VA_ARGS__)
#define LogInfo(...) DoLog(LOGLEVEL_INFO, LogTag, __VA_ARGS__)
#define LogDebug(...) DoLog(LOGLEVEL_DEBUG, LogTag, __VA_ARGS__)

#define Log(_format, ...) DoLog(LOGLEVEL_INFO, LogTag, @"line:%4d\t\t>>\t%@\n%42s",__LINE__,[NSString stringWithFormat:(_format), ##__VA_ARGS__],__FUNCTION__)

